<?php
	require_once 'projekt_st/spletne/PB/OsebaModel.php';
//baza

$streznik = $_SERVER["HTTP_HOST"];  
			
$pot = rtrim(dirname($_SERVER["PHP_SELF"]), "/\\");


if($_POST['ime'] != "" && $_POST['priimek'] != "" && $_POST['naslov'] != "" && $_POST['datumRojstva'] != "" && $_POST['posta'] != "" && $_POST['email'] != "" && $_POST['telefon'] != "" && $_POST['upIme'] != "" && $_POST['geslo'] != "" ) {    
    $model = new OsebaModel();
    $oseba = $model->registerOseba($_POST);
    mkdir("upload/".$_POST['upIme'],0777,true);
    header( "Location: http://".$streznik."".$pot."/index.php?status=uspeh" );
} 
else{
    header("Location: http://".$streznik."".$pot."/registracija.php?napaka=neuspeh");
    
} 

?>